<script setup>
// 路由信息 this.$route.query
// 路由实例 this.$router.push

import { useRoute, useRouter } from 'vue-router'
const route = useRoute() // 等价于    路由信息this.$route.query
const router = useRouter() // 等价于  路由实例this.$router.push

const handleClick = () => {
  router.push('/login')
}
</script>

<template>
  <div>首页组件</div>
  <button @click="handleClick">去登录</button>
</template>
